package com.rmb.common.model.response;

import lombok.ToString;



/**
 * @version 1.0
 * @Author a
 * @Date 2021/1/12 19:47
 */
@ToString
public enum CommonCode implements ResultCode{

    /**
     * 操作
     */
    SUCCESS(true,10000,"操作成功！"),
    QUERY_SUCCESS(true,10002,"查询成功！"),

    SERVER_ERROR(false,99999,"运行时异常！"),
    INVALID_PARAM(false,88888,"构建异常！"),
    THIS_ID_NULL(false,111110,"输入ID！"),
    FAIL(false,11111,"操作失败！"),
    PARAM_FALL(false,11112,"请求参数错误！"),
    THIS_OBJECT_NULL(false,11113,"对象不能为空"),
    FILE_GENERTIONEXCEPTION(false,11114,"类文件不存在"),
    RUNNING_PLEASE_CLOSE(false,11115,"正在运行，不能修改！"),
    SQL_WRONG_FORMAT(false,11116,"SQL格式错误！"),
    QUERY_FAIL(false,111117,"查询失败"),
    PARAMETER_CANNOT_BE_EMPTY(false,11118,"参数不能为空！"),
    PARAMETER_ABNORMAL(false,11119,"名称已存在或权重为空！"),

    BUSINESS_ALREADY_EXISTS(false,11110,"企业已经存在！"),
    BUSINESS_NOT_EXISTS(false,11120,"企业不存在！"),
    UPDATEED_SUCCESSFULLY(true,11121,"修改成功！"),
    DELETEED_SUCCESSFULLY(true,11123,"删除成功！"),
    ADDED_SUCCESSFULLY(true,11122,"添加成功！"),
    SENT_SUCCESSFULLY(true,11124,"发送成功！"),
    PHONE_NUMBER(true,11125,"手机号注册过了！"),
    VERIFICATION_NOT(true,11125,"验证码不正确！"),
    PASSWORDTWO_NOT(true,11125,"密码两次不同！"),
    INCORRECT_IMG_FORMAT(false,11126,"IMG格式不正确！"),
    FILE_TOO_BIG(false,11127,"文件过大！");
    //  private static ImmutableMap<Integer, CommonCode> codes ;
    /**
     * 操作是否成功
     */
    boolean success;

    /**
     * 操作代码
     */
    int code;

    /**
     * 提示信息
     */
    String message;

    private CommonCode(boolean success, int code, String message){
        this.success = success;
        this.code = code;
        this.message = message;
    }

    @Override
    public boolean success() {
        return success;
    }
    @Override
    public int code() {
        return code;
    }

    @Override
    public String message() {
        return message;
    }


}
